/**
 * @file   main.cpp
 * @author ywl <ywl@ywl-VirtualBox>
 * @date   Fri Nov 19 10:11:26 2021
 * 
 * @brief  设计一个四则混合运算器
 * 
 * 
 */

#include <iostream>
#include <string>
#include <cstdlib>
#include "calculator.h"
using namespace std;


const int MAX_EXP_LEN = 1000;	//最大表达式长度，防止内存溢出


int main( )
{
    calculator cal;
    cout << cal.operatorSym << endl;
    cout << "--------------" << endl;

    getline( cin, cal.infix );
    if( cal.infix.length( ) > MAX_EXP_LEN )
    {
	cout << "超出最大长度！" << endl;
	system( "pause" );
    }
    else
    {
	cal.calculate( );
	cout << cal.getResult( ) << endl;
    }
   
    return 0;
}
